package com.ap.core.domain;


import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.joda.time.LocalDateTime;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * User: Ranjit.Singh
 */
@Entity
@Table(name = "T_ZAPP_USER_VERIFICATION")
@AttributeOverride(name = "id",column = @Column(name = "VERIFICATION_ID"))
@TypeDef(name = "id", typeClass = String.class)
public class ZappUserVerification extends Identifiable<String> {

	private static final long serialVersionUID = -72137219837981273L;

	@Column(name = "ZAPP_ID")
    private Long ZappId;

    @Column(name = "VERIFIED_FLAG")
    private Boolean verificationFlag;

    @Column(name = "EXPIRY_TMSTMP")
    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")
    private LocalDateTime expiryTmstmp;

    private ZappUserVerification(){}

    public ZappUserVerification(String id, LocalDateTime expiryTmstmp, Long zappId) {
        this.id = id;
        this.expiryTmstmp = expiryTmstmp;
        this.verificationFlag = Boolean.FALSE;
        ZappId = zappId;
    }

    public LocalDateTime getExpiryTmstmp() {
        return expiryTmstmp;
    }

    public Boolean getVerificationFlag() {
        return verificationFlag;
    }

    public Long getZappId() {
        return ZappId;
    }
}
